/**
 * @author dreamcatcher
 * @date 2022/3/3 10:24
 * String 类中的正则表达式使用
 */
public class RegExp15 {
    public static void main(String[] args) {
        String content = "hello world hi wolrd";
        content = content.replaceAll("hello|hi","你好");
        System.out.println(content);


        String phone = "13888888888";
        if (phone.matches("^1[3|4|5|7|8][0-9]{9}$")){
            System.out.println("是电话号码！");
        }else{
            System.out.println("不是电话号码！");
        }

        String splitStr = "hello#world&hi%wolrd";
        String[] split = splitStr.split("[#&%]");
        for (String s : split){
            System.out.println(s);
        }
    }
}
